﻿using MediatR;
using SheepStorage.API.Application.Command.BuildingManagementCommand;
using SheepStorage.API.Application.Command.SheepManagementCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.DataImp;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepManagementHandler
{
    public class SheepManagementFtHandler : IRequestHandler<SheepManagementFtCommand, Results<SheepManagement>>
    {

        private readonly ISheepManagementService sheepManagementService;

        public SheepManagementFtHandler(ISheepManagementService sheepManagementService)
        {
            this.sheepManagementService = sheepManagementService;
        }
        public async Task<Results<SheepManagement>> Handle(SheepManagementFtCommand request, CancellationToken cancellationToken)
        {
            return Results<SheepManagement>.DataResult(sheepManagementService.GetFtSheepManagement(request.SheepManagementId));
        }
    }
}
